package com.entity;

import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@TableName("t_token")
public class Token {
    private Integer id;
    private Integer userId;
    private String username;
    private String tableName;
    private String role;
    private String token;
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    private Date createTime;
    private Date expireTime;
    private Date updateTime;

    public Token(Integer userId, String username, String tableName,String role, String token, Date expireTime) {
        super();
        this.userId = userId;
        this.username = username;
        this.tableName = tableName;
        this.role = role;
        this.token = token;
        this.expireTime = expireTime;
    }
}
